Ext.define('App.lib.ImageField', {
    extend : 'Ext.Panel',
    xtype : 'imageField',
    id:"imageField",
    requires : [ 'Ext.Img'],
    alias: 'widget.imageField',
    isField: true,
    isFormField: true,

    config : {
        name : null,
        value : null,
        items: [
            {
                xtype : 'img',
                id : 'self-img_photo',
                width : '100%',
                height : '100%',
                margin : '0 0 0 0',
                style : '{background-repeat:no-repeat; background-size:100% auto; background-position:center;}',
            },
        ],
    },

    setValue : function(path) {
        Ext.getCmp('self-img_photo').setSrc(path);
    },

    getValue : function() {
        return Ext.getCmp('self-img_photo').getSrc();
    },

});
